package com.mzy.basics.utils.Sql;

import java.util.regex.Pattern;

/**
 * @author Ives
 * * @date 2022/1/14
 */
public class regulerTwo {
  private String replaceSpecialCharacter(String content) {
    Pattern slash = Pattern.compile("\\\\");
    Pattern tab = Pattern.compile("\\t");
    Pattern newLine = Pattern.compile("\\n");
    Pattern doubleQuotes = Pattern.compile("\\\"");
    String stepOne = slash.matcher(content).replaceAll("\\\\\\\\");
    String stepTwo = tab.matcher(stepOne).replaceAll("\\\\t");
    String stepThree = newLine.matcher(stepTwo).replaceAll("\\\\n");
    String stepFour = doubleQuotes.matcher(stepThree).replaceAll("\\\\\\\"");
    return stepFour;
  }
}
